﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace IT_Pro.Forms
{
    public partial class frmMayViTinh_ChiTiet : DevExpress.XtraEditors.XtraForm
    {
        public frmMayViTinh_ChiTiet()
        {
            InitializeComponent();
        }

        public frmMayViTinh_ChiTiet(string mamay)
        {
            InitializeComponent();
            gridLinhKien.DataSource = Class.MT_CTMayViTinh.HienthidsCTMayInfo(mamay);
            fnc_CreateIndex(gridDanhSachLinhKien, ct_colum1);
            this.Text+=": "+ mamay;
        }

        private void fnc_CreateIndex(DevExpress.XtraGrid.Views.BandedGrid.BandedGridView gridname, DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn columname)
        {

            for (int i = 0; i < gridname.RowCount; i++)
            {
                gridname.SetRowCellValue(i, columname.FieldName, i + 1);
            }
            gridname.BestFitColumns();
        }
    }
}